package com.warm.demo.scheduling;

import cn.dev33.satoken.annotation.SaIgnore;
import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.validation.annotation.Valid;

/**
 * 异步执行的服务调用
 *
 * @author warm
 */
@Slf4j
@SaIgnore
@Mapping("/demo/scheduling")
@Valid
@Controller
public class SchedulingController {
    @Inject
    AsyncTask asyncTask;

    @Inject
    RetryTask retryTask;

    @Mapping("/asyncTask")
    public void asyncTask() {
        log.info("进入异步Controller");
        // 调用
        asyncTask.test("test");
    }

    @Mapping("/retryTask")
    public void retryTask() {
        log.info("进入重试Controller");
        // 调用
        retryTask.test("test");
    }
}